import { RouteRecordRaw } from 'vue-router'
import { SimplifyBasicLayout, RouteLayout, BlankLayout, LevelBasicLayout } from '@/layouts'

// 主路由
const mainRoutes: RouteRecordRaw[] = [
	{
		path: '/userManage',
		name: 'userManage',
		component: () => import('@/views/userManage/index.vue'),
		meta: { title: '人员管理', hidden: false, icon: 'icon-yonghuguanli' }
	},
	{
		path: '/qualificationsSys',
		name: 'qualificationsSys',
		component: RouteLayout,
		meta: { title: '资质管理', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/qualificationsSys/company',
				name: 'company',
				component: () => import('@/views/qualificationsSys/company/index.vue'),
				meta: { title: '单位资质类', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/qualificationsSys/transportationCertificate',
				name: 'transportationCertificate',
				component: () => import('@/views/qualificationsSys/transportationCertificate/index.vue'),
				meta: { title: '运证', hidden: false, icon: 'icon-zhengjianbanli' }
			},
			{
				path: '/qualificationsSys/principalResponsiblePerson',
				name: 'principalResponsiblePerson',
				component: () => import('@/views/qualificationsSys/principalResponsiblePerson/index.vue'),
				meta: { title: '负责人、安全管理人员', hidden: false, icon: 'icon-anquanguanli' }
			},
			{
				path: '/qualificationsSys/specialManagementPersonnel',
				name: 'specialManagementPersonnel',
				component: () => import('@/views/qualificationsSys/specialManagementPersonnel/index.vue'),
				meta: { title: '特种管理人员', hidden: false, icon: 'icon-tezhonghangyexukezheng' }
			},
			{
				path: '/qualificationsSys/explosionRelatedOperators',
				name: 'explosionRelatedOperators',
				component: () => import('@/views/qualificationsSys/explosionRelatedOperators/index.vue'),
				meta: { title: '涉爆作业人员', hidden: false, icon: 'icon-man-warning-fill' }
			},
			{
				path: '/qualificationsSys/otherQualifiedPersonnel',
				name: 'otherQualifiedPersonnel',
				component: () => import('@/views/qualificationsSys/otherQualifiedPersonnel/index.vue'),
				meta: { title: '其他资质人员', hidden: false, icon: 'icon-renyuanxinxi-copy' }
			}
		]
	},
	{
		path: '/safetyAnalysis',
		name: 'safetyAnalysis',
		component: RouteLayout,
		meta: { title: '安全分析', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/safetyAnalysis/safetyInspectionAnalysis',
				name: 'safetyInspectionAnalysis',
				component: () => import('@/views/qualificationsSys/safetyInspectionAnalysis/index.vue'),
				meta: { title: '安全检查分析', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/safetyHazardAnalysis',
				name: 'safetyHazardAnalysis',
				component: () => import('@/views/qualificationsSys/safetyHazardAnalysis/index.vue'),
				meta: { title: '安全隐患分析', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/emergencyDrillAnalysis',
				name: 'emergencyDrillAnalysis',
				component: () => import('@/views/qualificationsSys/emergencyDrillAnalysis/index.vue'),
				meta: { title: '应急演练分析', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/educationTrainingAnalysis',
				name: 'educationTrainingAnalysis',
				component: () => import('@/views/qualificationsSys/educationTrainingAnalysis/index.vue'),
				meta: { title: '教育培训分析', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/accidentStatisticalAnalysis',
				name: 'accidentStatisticalAnalysis',
				component: () => import('@/views/qualificationsSys/accidentStatisticalAnalysis/index.vue'),
				meta: { title: '事故统计分析', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/statisticsHazardousChemicals',
				name: 'statisticsHazardousChemicals',
				component: () => import('@/views/qualificationsSys/statisticsHazardousChemicals/index.vue'),
				meta: { title: '危化品统计', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/safetyAnalysis/statisticsSpecialEquipment',
				name: 'statisticsSpecialEquipment',
				component: () => import('@/views/qualificationsSys/statisticsSpecialEquipment/index.vue'),
				meta: { title: '特种设备统计', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/quantitativeEvaluationSys',
		name: 'quantitativeEvaluationSys',
		component: RouteLayout,
		meta: { title: '量化评估系统', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/quantitativeEvaluationSys/inspectionPlan',
				name: 'inspectionPlan',
				component: () => import('@/views/quantitativeEvaluationSys/inspectionPlan/index.vue'),
				meta: { title: '我的检查计划', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/quantitativeEvaluationSys/securityCheck',
				name: 'securityCheck',
				component: () => import('@/views/quantitativeEvaluationSys/securityCheck/index.vue'),
				meta: { title: '安全检查', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/rulesRegulations',
		name: 'rulesRegulations',
		component: RouteLayout,
		meta: { title: '规章制度管理', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/rulesRegulations/safetyRulesRegulations',
				name: 'safetyRulesRegulations',
				component: () => import('@/views/rulesRegulations/safetyRulesRegulations/index.vue'),
				meta: { title: '安全规章制度', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/rulesRegulations/lawsRegulations',
				name: 'lawsRegulations',
				component: () => import('@/views/rulesRegulations/lawsRegulations/index.vue'),
				meta: { title: 'EHS法律法规', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/rulesRegulations/operatingProcedures',
				name: 'operatingProcedures',
				component: () => import('@/views/rulesRegulations/operatingProcedures/index.vue'),
				meta: { title: '操作规程', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/meetEmergency',
		name: 'meetEmergency',
		component: RouteLayout,
		meta: { title: '应急管理系统', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/meetEmergency/organization',
				name: 'organization',
				component: () => import('@/views/meetEmergency/organization/index.vue'),
				meta: { title: '组织机构', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/emergencyPlan',
				name: 'emergencyPlan',
				component: () => import('@/views/meetEmergency/emergencyPlan/index.vue'),
				meta: { title: '应急预案', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/emergencySupplies',
				name: 'emergencySupplies',
				component: () => import('@/views/meetEmergency/emergencySupplies/index.vue'),
				meta: { title: '应急物资', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/emergencyDrill',
				name: 'emergencyDrill',
				component: () => import('@/views/meetEmergency/emergencyDrill/index.vue'),
				meta: { title: '应急演练', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/emergencyRescue',
				name: 'emergencyRescue',
				component: () => import('@/views/meetEmergency/emergencyRescue/index.vue'),
				meta: { title: '应急救援', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/emergencyDisposalCard',
				name: 'emergencyDisposalCard',
				component: () => import('@/views/meetEmergency/emergencyDisposalCard/index.vue'),
				meta: { title: '应急处置卡', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/assetDistributionMap',
				name: 'assetDistributionMap',
				component: () => import('@/views/meetEmergency/assetDistributionMap/index.vue'),
				meta: { title: '动态可视化物资分布图', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/escapeDiagram',
				name: 'escapeDiagram',
				component: () => import('@/views/meetEmergency/escapeDiagram/index.vue'),
				meta: { title: '动态应急演练逃生示意图', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/meetEmergency/schematicDiagramScheme',
				name: 'schematicDiagramScheme',
				component: () => import('@/views/meetEmergency/schematicDiagramScheme/index.vue'),
				meta: { title: '动态现场处置方案示意图', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/educationTrainingSys',
		name: 'educationTrainingSys',
		component: RouteLayout,
		meta: { title: '教育培训管理系统', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/educationTrainingSys/educationTraining',
				name: 'educationTraining',
				component: () => import('@/views/educationTrainingSys/educationTraining/index.vue'),
				meta: { title: '教育培训', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/educationTrainingSys/onlineExamination',
				name: 'onlineExamination',
				component: () => import('@/views/educationTrainingSys/onlineExamination/index.vue'),
				meta: { title: '在线考试', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/accidentSys',
		name: 'accidentSys',
		component: RouteLayout,
		meta: { title: '事故管理', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/accidentSys/accidentReturnZero',
				name: 'accidentReturnZero',
				component: () => import('@/views/accidentSys/accidentReturnZero/index.vue'),
				meta: { title: '事故归零', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/accidentSys/accidentAccount',
				name: 'accidentAccount',
				component: () => import('@/views/accidentSys/accidentAccount/index.vue'),
				meta: { title: '事故台帐', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/accidentSys/accidentsDrawInferencesInstance',
				name: 'accidentsDrawInferencesInstance',
				component: () => import('@/views/accidentSys/accidentsDrawInferencesInstance/index.vue'),
				meta: { title: '事故举一反三', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/occupationalHealth',
		name: 'occupationalHealth',
		component: RouteLayout,
		meta: { title: '职业卫生管理', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/occupationalHealth/occupationalHazardFactors',
				name: 'occupationalHazardFactors',
				component: () => import('@/views/occupationalHealth/occupationalHazardFactors/index.vue'),
				meta: { title: '职业危害因素', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/occupationalHealth/laborProtectionArticles',
				name: 'laborProtectionArticles',
				component: () => import('@/views/occupationalHealth/laborProtectionArticles/index.vue'),
				meta: { title: '劳动防护用品', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	},
	{
		path: '/otherSecuritySys',
		name: 'otherSecuritySys',
		component: RouteLayout,
		meta: { title: '其他安全管理', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/otherSecuritySys/relatedPartyMan',
				name: 'relatedPartyMan',
				component: () => import('@/views/otherSecuritySys/relatedPartyMan/index.vue'),
				meta: { title: '相关方管理', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/otherSecuritySys/dangerPoint',
				name: 'dangerPoint',
				component: () => import('@/views/otherSecuritySys/dangerPoint/index.vue'),
				meta: { title: '危险点管理', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/otherSecuritySys/hazardousChemicals',
				name: 'hazardousChemicals',
				component: () => import('@/views/otherSecuritySys/hazardousChemicals/index.vue'),
				meta: { title: '危化品管理', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/otherSecuritySys/specialEquipmentSys',
				name: 'specialEquipmentSys',
				component: BlankLayout,
				meta: { title: '特种设备管理', hidden: false, icon: 'icon-zizhizhengshu' },
				children: [
					{
						path: '/otherSecuritySys/specialEquipmentSys/motorVehicle',
						name: 'motorVehicle',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/motorVehicle.vue'),
						meta: { title: '机动车辆管理', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/factoryElevator',
						name: 'factoryElevator',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/factoryElevator.vue'),
						meta: { title: '工厂电梯管理', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/liftingMachinery',
						name: 'liftingMachinery',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/liftingMachinery.vue'),
						meta: { title: '起重机械管理', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/pressureVessel',
						name: 'pressureVessel',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/pressureVessel.vue'),
						meta: { title: '压力容器管理', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/simplePressureVessel',
						name: 'simplePressureVessel',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/simplePressureVessel.vue'),
						meta: { title: '简单压力容器管理', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/idleScrapped',
						name: 'idleScrapped',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/idleScrapped.vue'),
						meta: { title: '特种设备闲置、报废', hidden: false, icon: 'icon-zizhizhengshu' }
					},
					{
						path: '/otherSecuritySys/specialEquipmentSys/specialOperation',
						name: 'specialOperation',
						component: () => import('@/views/otherSecuritySys/specialEquipmentSys/specialOperation.vue'),
						meta: { title: '特种作业', hidden: false, icon: 'icon-zizhizhengshu' }
					}
				]
			}
		]
	},
	{
		path: '/foundationPlatform',
		name: 'foundationPlatform',
		component: RouteLayout,
		meta: { title: '基础平台', hidden: false, icon: 'icon-zizhiguanli' },
		children: [
			{
				path: '/foundationPlatform/taskMan',
				name: 'taskMan',
				component: () => import('@/views/foundationPlatform/taskMan/index.vue'),
				meta: { title: '任务管理', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/dataDictionary',
				name: 'dataDictionary',
				component: () => import('@/views/foundationPlatform/dataDictionary/index.vue'),
				meta: { title: '数据字典', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/branchSetting',
				name: 'branchSetting',
				component: () => import('@/views/foundationPlatform/branchSetting/index.vue'),
				meta: { title: '分管设置', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/processCustomization',
				name: 'processCustomization',
				component: () => import('@/views/foundationPlatform/processCustomization/index.vue'),
				meta: { title: '流程自定义', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/inspectorSettings',
				name: 'inspectorSettings',
				component: () => import('@/views/foundationPlatform/inspectorSettings/index.vue'),
				meta: { title: '检查人员设置', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/permissionSettings',
				name: 'permissionSettings',
				component: () => import('@/views/foundationPlatform/permissionSettings/index.vue'),
				meta: { title: '权限设置', hidden: false, icon: 'icon-zizhizhengshu' }
			},
			{
				path: '/foundationPlatform/logQuery',
				name: 'logQuery',
				component: () => import('@/views/foundationPlatform/logQuery/index.vue'),
				meta: { title: '日志查询', hidden: false, icon: 'icon-zizhizhengshu' }
			}
		]
	}
]

// 基础路由
const Routes: Array<RouteRecordRaw> = [
	{
		path: '/login',
		name: 'login',
		component: () => import(/* webpackChunkName: "login" */ '@/views/user/login')
	},
	{
		path: '/',
		redirect: '/userManage',
		component: SimplifyBasicLayout,
		children: mainRoutes
	},
	{
		path: '/403',
		name: '403',
		component: () => import(/* webpackChunkName: "403" */ '@/views/exception/403'),
		meta: { title: '403', permission: ['exception'], hidden: true }
	},
	{
		path: '/404',
		name: '404',
		component: () => import(/* webpackChunkName: "404" */ '@/views/exception/404'),
		meta: { title: '404', permission: ['exception'], hidden: true }
	},
	{
		path: '/500',
		name: '500',
		component: () => import(/* webpackChunkName: "500" */ '@/views/exception/500'),
		meta: { title: '500', permission: ['exception'], hidden: true }
	},
	{
		path: '/:pathMatch(.*)',
		name: 'error',
		component: () => import(/* webpackChunkName: "404" */ '@/views/exception/404'),
		meta: { title: '404', hidden: true }
	}
]

export { Routes }
